<template>
  <div class="categoryList-container">
    <search-header class="categorylist-header">
      <template v-slot:left>
        <van-icon name="arrow-left" color="#aaa9a9" @click="goBack" />
      </template>
      <template v-slot:mid> {{ name }} </template>
      <template v-slot:right>
        <router-link to="/search">
          <van-icon name="search" size="25px"
        /></router-link>
      </template>
    </search-header>
    <div class="content-box">
      <comp-list :menulist="list"></comp-list>
    </div>
  </div>
</template>

<script>
import searchHeader from "../components/search-header.vue";
import CompList from "../components/comp-list.vue";
export default {
  components: { searchHeader, CompList },
  data() {
    return {
      list: [],
      name: "",
    };
  },
  methods: {
    goBack() {
      this.$router.back();
    },
  },
  created() {
    this.list = JSON.parse(localStorage.getItem("list"));
    this.name = this.$route.query.name;
  },
};
</script>

<style lang="less" scoped>
.categoryList-container {
  padding-top: 40px;
  .categorylist-header {
    height: 40px;
    line-height: 40px;
    .van-icon {
      padding-top: 10px;
    }
  }
}
</style>